from po.base_api import Base_Api


class Course(Base_Api):  # mscourse 返回的课程id错误
    def course_index(self):
        data = {
            "method": "get",
            "url": self.host + '/zxx/v4/course'
        }
        r = self.send(data)
        return r

    def open_class(self, cateid):
        data = {
            "method": "get",
            "url": self.host + "/zxx/v4/course/opens",
            "params": {"cateid": cateid}
        }
        r = self.send(data)
        return r

    def charge_course(self, cateid):
        data = {
            "method": "get",
            "url": self.host + "/zxx/v4/course/lists",
            "params": {"cateid": cateid}
        }
        r = self.send(data)
        return r

    def charge_course_sx(self, cateid, kwargs):
        data = {
            "method": "get",
            "url": self.host + "/zxx/v4/course/lists",
            "params": {"cateid": cateid, **kwargs}
        }
        r = self.send(data)
        return r

    def charge_course_ms(self, cateid, type):
        data = {
            "method": "get",
            "url": self.host + "/zxx/v4/course/lists",
            "params": {"cateid": cateid, "type": type}
        }
        r = self.send(data)
        return r


    def cource_detail(self,cid,uid):
        data = {
            "method":"get",
            "url":self.host+"/zxx/v4/course/detail",
            "params":{
                "cid":cid,
                "uid":uid
            }
        }
        r = self.send(data)
        return  r


